package engine.control.loading
{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import newx.com.ResManager;

	/**
	 * 
	 * @author hanjy
	 */
	public class NxLoadingSkin extends MovieClip
	{
		private var _loadingBG		:Sprite;
		private var _loadingBar	:Sprite;
		private var _loadingPoint	:Sprite = null;
		/**
		 * loading皮肤 
		 * @param _skin
		 * @param isPt 是否有引导点
		 * 
		 */
		public function NxLoadingSkin(_skin:String="",isPt:Boolean=false)
		{
			var loadingSkin:Sprite = ResManager.newResClass(_skin) as Sprite;
			loadingBG = loadingSkin.getChildByName("loadingLineBack") as Sprite;
			loadingBar	=	loadingSkin.getChildByName("loadingLine") as Sprite;
			if(isPt){
				var pointMask:Sprite	=	new Sprite();
				pointMask.graphics.beginFill(0);
				pointMask.graphics.drawRect(loadingBar.x,loadingBar.y,loadingBar.width,loadingBar.height);
				pointMask.graphics.endFill();
				_loadingPoint	=	loadingSkin.getChildByName("loadingPoint") as Sprite;
				_loadingPoint.x	=	20;
				_loadingPoint.mask = pointMask;
			}
			addChild(loadingSkin);
			
		}

		public function get loadingPoint():Sprite
		{
			return _loadingPoint;
		}

		public function set loadingPoint(value:Sprite):void
		{
			_loadingPoint = value;
		}

		public function get loadingBG():Sprite
		{
			return _loadingBG;
		}

		public function set loadingBG(value:Sprite):void
		{
			_loadingBG = value;
		}

		public function get loadingBar():Sprite
		{
			return _loadingBar;
		}

		public function set loadingBar(value:Sprite):void
		{
			_loadingBar = value;
		}

	}
}